
const getSectionInfo = (callback) => {


    $.getJSON(GLOBAL_allPcateUrl, function(data) {
        callback(data);
    });

};
const renderSectionView = (data, defaultid) => {
    let sectionOptionHtml = '<option value="0">请选择</option>';

    $.each(data.data, (key, val) => {

        let option = `<option value=${val.id}>${val.name_zh}-${val.name_en}</option>`;
        if (defaultid && parseInt(defaultid, 10) === parseInt(val.id, 10)) {
            option = `<option value=${val.id} selected>${val.name_zh}-${val.name_en}</option>`;
        }
        sectionOptionHtml += option;
    });
    $('#pid').html(sectionOptionHtml);

};

export{getSectionInfo,renderSectionView}